<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [

        Commands\SpiderYYETS::class,
        Commands\SpiderTtmj::class,
        Commands\SpiderEztv::class,

        Commands\FetchNewsJkmj::class,
        Commands\FetchNewsTyxz::class,
        Commands\FetchNewsYyets::class,

        Commands\SortEpisode::class,
        Commands\SortArticle::class,
        Commands\SortMovie::class,
        Commands\SortTtmjEpisode::class,
        Commands\SortFillTtmjShowDetail::class,
        Commands\SortYyetsEpisodes::class,
        Commands\CleanDb::class,
        Commands\Play::class,
        Commands\SpiderCnbetaNews::class,
        Commands\ImgurFetcher::class,
        Commands\SpiderTttmjNews::class,

        //
    ];

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {

        $schedule->command('spider:eztvep')->cron('0 * * * *')->withoutOverlapping();

        $schedule->command('spider:ttmjep')->cron('10 * * * *')->withoutOverlapping();

        $schedule->command('spider:yyetsep')->cron('15 * * * *')->withoutOverlapping();
//spider:ttmjnews
        $schedule->command('spider:ttmjnews')->cron('20 * * * *')->withoutOverlapping();

        $schedule->command('spider:yyetsnews')->cron('25 * * * *')->withoutOverlapping();

        $schedule->command('spider:tyzxnews')->cron('30 * * * *')->withoutOverlapping();


        //spider:cnbetaNews
        $schedule->command('spider:cnbetaNews')->cron('35 * * * *')->withoutOverlapping();

        $schedule->command('spider:jkmjnews')->cron('40 * * * *')->withoutOverlapping();

        //微博token错误
        //$schedule->command('spider:weibo')->twiceDaily(9, 12)->withoutOverlapping();


        $schedule->command('sort:396episodes')->dailyAt('3:15');//每天晚上整理396美剧;

        $schedule->command('zhou:clearDB')->dailyAt('2:41');//删除没有用的ep show 数据
        $schedule->command('sort:ShowDetail')->dailyAt('3:41');//删除没有用的ep show 数据
        $schedule->command('sort:episode')->dailyAt('4:41');//删除没有用的ep show 数据
        $schedule->command('sort:ttmjEpisode')->dailyAt('5:41');//删除没有用的ep show 数据
        $schedule->command('sort:article')->dailyAt('5:11');

        $schedule->command('cache:clear')->cron('45 * * * *')->withoutOverlapping();


    }
}
